<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Messages:  Random Murphy's Law</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT = "no-cache">
<META NAME="date" CONTENT="2000-09-09">
<META NAME="channel" CONTENT="Web Developer">
<META NAME="author" CONTENT="Tomer & Yehuda Shiran">
<META NAME="section" CONTENT="Messages">
<META NAME="description" CONTENT="I know you've heard of those witty little Murphy's Laws...  Well, now you can have them on your web page!  JavaScript can pick one and display it randomly each time your page is loaded!">

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getMessage() {
var ar = new Array(20)
ar[0] = "Nothing is as easy as it looks."
ar[1] = "Everything takes longer than you think."
ar[2] = "Anything that can go wrong will go wrong."
ar[3] = "If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong."
ar[4] = "If there is a worse time for something to go wrong, it will happen then."
ar[5] = "If anything simply cannot go wrong, it will anyway."
ar[6] = "If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop."
ar[7] = "Left to themselves, things tend to go from bad to worse."
ar[8] = "If everything seems to be going well, you have obviously overlooked something."
ar[9] = "Nature always sides with the hidden flaw."
ar[10] = "Mother nature is a bitch."
ar[11] = "It is impossible to make anything foolproof because fools are so ingenious."
ar[12] = "Whenever you set out to do something, something else must be done first."
ar[13] = "Every solution breeds new problems."
ar[14] = "Trust everybody ... then cut the cards."
ar[15] = "Two wrongs are only the beginning."
ar[16] = "If at first you don't succeed, destroy all evidence that you tried."
ar[17] = "To succeed in politics, it is often necessary to rise above your principles."
ar[18] = "Exceptions prove the rule ... and wreck the budget."
ar[19] = "Success always occurs in private, and failure in full view."
var now = new Date()
var sec = now.getSeconds()
alert("Murphy's Law:\r" + ar[sec % 20])
}
// End -->
</SCRIPT>
</HEAD>

<BODY BGCOLOR=#ffffff vlink=#0000ff onload="getMessage()">

<BR>
<center>
<table width="600" cellpadding="0" cellspacing="10">
<tr>
<td width="468" align="center">

	
</td>
<td width="120" align="center">

	
</td>
</tr>
</table>
<BR>
<BR>
<BASEFONT SIZE=3>
  <FONT SIZE=6>
<B><FONT SIZE="+2" FACE="Helvetica,Arial" ALIGN=RIGHT COLOR="#0000FF">
<b><A HREF="../index.htm" /" TARGET="_top">
Home</A> </b><img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}"> <b><A HREF="index.htm" /messages/"><font color="#FF0000">Messages</font></A> </b>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}"> <FONT COLOR="#006666">Random Murphy's Law</FONT></b></FONT><BR>
</B><BR>
  </FONT>
<TABLE BORDER=0 WIDTH=500 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE=" helvetica,arial,geneva">
<br>
<br>
<!-- Description --><!--content_start-->

I know you've heard of those witty little Murphy's Laws...  Well, now you can have them on your web page!  JavaScript can pick one and display it randomly each time your page is loaded!<br><hr>
</td></tr>
</table>
<!--  Demonstration -->
<BODY>
<CENTER>
<FORM>
<input type="button" Value="New Murphy's Law" onClick="getMessage()">
</FORM>
</CENTER>
<P>
<BR>
<P>
<a name="source">
<TABLE BORDER=0 WIDTH=500 CELLPADDING=3 CELLSPACING=0>
<tr><td BGCOLOR=yellow><font FACE="helvetica,arial,geneva"><b>JavaScript Source Code 3000:  Messages:  Random Murphy's Law</b>
<p>Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as NotePad or SimpleText) and save (Control-s or Apple-s).  The script is yours!<br><br></font></td></tr>
<tr><td BGCOLOR=yellow ALIGN=CENTER>
<form NAME="copy">

<DIV align="center">
<input type=button value="Highlight All" onClick="javascript:this.form.txt.focus();this.form.txt.select();">&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" NAME="total" VALUE="Script Size:  2.46 KB  " size="24">
</DIV>

<textarea NAME="txt" ROWS=20 COLS=75 WRAP=VIRTUAL>

&lt;!-- THREE STEPS TO INSTALL RANDOM MURPHY'S LAW:

   1.  Paste the coding into the HEAD of your HTML document
   2.  Copy the onLoad event handler into the BODY tag
   3.  Add the last code into the BODY of your HTML document  --&gt;

&lt;!-- STEP ONE: Copy this code into the HEAD of your HTML document  --&gt;

&lt;HEAD&gt;

&lt;SCRIPT LANGUAGE="JavaScript"&gt;
&lt;!-- Original:  Tomer & Yehuda Shiran &lt;yshiran@iil.intel.com&gt;

&lt;! &gt;
&lt;! &gt;

&lt;!-- Begin
function getMessage() {
var ar = new Array(20)
ar[0] = "Nothing is as easy as it looks."
ar[1] = "Everything takes longer than you think."
ar[2] = "Anything that can go wrong will go wrong."
ar[3] = "If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong."
ar[4] = "If there is a worse time for something to go wrong, it will happen then."
ar[5] = "If anything simply cannot go wrong, it will anyway."
ar[6] = "If you perceive that there are four possible ways in which a procedure can go wrong, and circumvent these, then a fifth way, unprepared for, will promptly develop."
ar[7] = "Left to themselves, things tend to go from bad to worse."
ar[8] = "If everything seems to be going well, you have obviously overlooked something."
ar[9] = "Nature always sides with the hidden flaw."
ar[10] = "Mother nature is a bitch."
ar[11] = "It is impossible to make anything foolproof because fools are so ingenious."
ar[12] = "Whenever you set out to do something, something else must be done first."
ar[13] = "Every solution breeds new problems."
ar[14] = "Trust everybody ... then cut the cards."
ar[15] = "Two wrongs are only the beginning."
ar[16] = "If at first you don't succeed, destroy all evidence that you tried."
ar[17] = "To succeed in politics, it is often necessary to rise above your principles."
ar[18] = "Exceptions prove the rule ... and wreck the budget."
ar[19] = "Success always occurs in private, and failure in full view."
var now = new Date()
var sec = now.getSeconds()
alert("Murphy's Law:\r" + ar[sec % 20])
}
// End --&gt;
&lt;/SCRIPT&gt;

&lt;!-- STEP TWO: Add this onLoad event handler into the BODY tag  --&gt;

&lt;BODY onLoad="getMessage()"&gt;

&lt;!-- STEP THREE: Put this code into the BODY of your HTML document  --&gt;

&lt;CENTER&gt;
&lt;FORM&gt;
&lt;input type="button" Value="New Murphy's Law" onClick="getMessage()"&gt;
&lt;/FORM&gt;
&lt;/CENTER&gt;

 

&lt;!-- Script Size:  2.46 KB  --&gt;
</textarea><br><font FACE="helvetica,arial,geneva"></font></td></tr>

</table>
</form>
</FONT>
</CENTER>


</center>
</body></html>